//package com.ants.platform.core.db.dbutils;
//
//import com.alibaba.druid.pool.DruidDataSource;
//import com.alibaba.druid.pool.DruidDataSourceFactory;
//import org.apache.commons.dbutils.QueryRunner;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//
//import java.io.IOException;
//import java.io.InputStream;
//import java.util.Properties;
//
///**
// * 利用阿里连接池+DBUtils操作数据库
// * 封装了配置文件
// * Created by liushun on 2016/3/10.
// */
//public class _dbutils extends QueryRunner {
//
//    private static final Logger logger = LoggerFactory.getLogger(_dbutils.class);
//
//    private static DruidDataSource dataSource = null;
//
//
//    static {
//        Properties properties = new Properties();
//        //读取resources下面的配置
//        InputStream is = _dbutils.class.getResourceAsStream("/config.properties");
//        try {
//            properties.load(is);
//            try {
//                //通过createDataSource方法将数据源相关配置属性自动传入 [详情查看DruidDataSourceFactory类下的config(DruidDataSource dataSource, Map properties)]
//                dataSource = (DruidDataSource) DruidDataSourceFactory.createDataSource(properties);
//                //或者通过set 数据源相关配置手动传入
//                //dataSource.setMinIdle(50);
//                logger.info("connecting to the DruidDataSource is success!");
//            } catch (Exception e) {
//                logger.error("connecting to the DruidDataSource is error " + e.getMessage());
//            }
//        } catch (IOException e) {
//            logger.error("config.properties is no found !" + e.getMessage());
//        }
//
//    }
//
//    public _dbutils() {
//        super(dataSource);
//    }
//}
